package utils;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DBUtil {
    public static Connection getConnection() {
    try {
        Class.forName("com.mysql.jdbc.Driver");
        String url = "jdbc:mysql://154.91.179.153/db_005";
        String dbuser = "user005";
        String dbpass = "222019#web";
        return DriverManager.getConnection(url, dbuser, dbpass);
    } catch (ClassNotFoundException | SQLException cnfe) {
        cnfe.printStackTrace();
        return null;
    }

}

    public static void freeConnection(Connection conn) {
        try {
            conn.close();
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }
}